package com.state.example;
//上午工作状态
public class ForenoonState extends State {
    @Override
    public void writeProgram(Work w) {
        if(w.hour < 12){
            System.out.println("当前时间:"+w.hour);
        }else {
            w.setState(new NoonState());
            w.writeProgram();
        }
    }
}
